<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./echarts.min.js"></script>
    <style>
      div{
       border: 1px solid #000;
      }
    </style>
  </head>
  <body>
    <div id="main" style="width: 800px; height: 600px"></div>
    <script>
      var myCharts = echarts.init(document.querySelector("#main"));
      const option = {
        title: {
          text: "班级薪资分布",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          bottom: "5%",
          left: "center",
        },
        color: ["#f2a009", "#6499ff", "#66cfff", "#5dd499"],
        series: [
          {
            name: "班级薪资分布",
            type: "pie",
            radius: ["30%", "40%"],
            avoidLabelOverlap: false,
            itemStyle: {
              borderRadius: 15,
              borderColor: "#fff",
              borderWidth: 2,
            },
            label: {
              show: false,
              position: "center",
            },
            emphasis: {
              label: {
                show: true,
                fontSize: 40,
                fontWeight: "bold",
              },
            },
            labelLine: {
              show: false,
            },
            data: [
              { value: 1048, name: "Search Engine" },
              { value: 735, name: "Direct" },
              { value: 484, name: "Union Ads" },
              { value: 300, name: "Video Ads" },
            ],
          },
        ],
      };
      myCharts.setOption(option);
    </script>
  </body>
</html>
